﻿using SqlDao;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SqlDaoDemo
{
    /// <summary>
    /// SQLiteWindow.xaml 的交互逻辑
    /// </summary>
    public partial class SQLiteWindow : Window
    {
        public string DbFile
        {
            get
            {
                return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data.db");
            }
        }

        public SQLiteWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// connect if not exist Create database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void ConnBtn_Click(object sender, RoutedEventArgs e)
        {
            DbHelper.isDebug = true;
            SqliteHelper helper = SqliteHelper.Instance;

            var res = helper.CreateDatabase(DbFile);
            Console.WriteLine(res);
        }
    }
}
